import random

def selectionSort(A):
	print A
	N = len(A)
	eIndex = 0
	for k in range(0, N):
		key = A[k]
		for j in range(k, N):
			if key >= A[j]:
				key = A[j]
				eIndex = j

		A[k], A[eIndex] = A[eIndex], A[k]

	return A





A = [random.randint(1, 20) for k in range(20)]
print selectionSort(A)